      subroutine updjin(i,im)

      use param

#include <global.h>
      include 'ntbytes.h'
      include 'geom.h'
      include 'geomf.h'
      include 'nem.h'

      integer,intent(in) :: i,im

      im1=i-1
      ip1=i+1
      if (i.eq.1) then
        if (bcb.eq.0) then ! reflective boundary on left/bottom
          jinl(1,i,im)=joutl(1,i,im)
          jinl(2,i,im)=joutl(2,i,im)
        elseif (bcb.eq.1) then ! vacuum boundary
          jinl(1,i,im)=0
          jinl(2,i,im)=0 
        endif
        jinl(1,ip1,im)=joutr(1,i,im)
        jinl(2,ip1,im)=joutr(2,i,im)
      elseif (i.eq.fnode) then
        if (bcu.eq.0) then ! reflective boundary on right/top
          jinr(1,i,im)=joutr(1,i,im)
          jinr(2,i,im)=joutr(2,i,im)
        elseif (bcu.eq.1) then ! vacuum boundary
          jinr(1,i,im)=0
          jinr(2,i,im)=0
        endif
        jinr(1,im1,im)=joutl(1,i,im)
        jinr(2,im1,im)=joutl(2,i,im)
      else
        jinl(1,ip1,im)=joutr(1,i,im)  
        jinl(2,ip1,im)=joutr(2,i,im)
        jinr(1,im1,im)=joutl(1,i,im)
        jinr(2,im1,im)=joutl(2,i,im)  
      endif

      end subroutine
